import Vue from 'vue'
import Router from 'vue-router'
import pageLoading from '../componentes/global/pageLoading.vue'

Vue.use(Router)

export default new Router({
  routes: [{
      path: '/',
      components: {
        default: resolve => require(['../pages/home/app.vue'], resolve),
      },
      children: [
        {
          path: '',
          name: 'login',
          components: {
            default: resolve => require(['src/pages/login.vue'], resolve),
          }
        },
        {
          path: '/home',
          name: 'home',
          meta: { keepAlive: true},
          components: {
            default: resolve => require(['../pages/home/main.vue'], resolve),
          }
        },
          {
          path: '/NewPos',
          name: 'NewPos',
          components: {
            default: resolve => require(['../pages/home/NewPos.vue'], resolve),
          }
        },
        {
          path: '/market',
          name: 'market',
          components: {
            default: resolve => require(['../pages/market/index.vue'], resolve),
            // myLoading: pageLoading
          }
        },
        // {
        //   path: '/publicity',
        //   name: 'publicity',
        //   components: {
        //     default: resolve => require(['../pages/publicity/index.vue'], resolve),
        //     myLoading: pageLoading
        //   }
        // },
        // {
        //   path: '/block-list/:usrId',
        //   name: 'block-list',
        //   components: {
        //     default: resolve => require(['../pages/publicity/blockList.vue'], resolve)
        //   }
        // },
        {
          path: '/find',
          name: 'find',
          components: {
            default: resolve => require(['../pages/find/index.vue'], resolve),
            myLoading: pageLoading
          }
        },
        {
          path: '/findDetail',
          name: 'findDetail',
          components: {
            default: resolve => require(['../pages/find/detail.vue'], resolve),
            myLoading: pageLoading
          }
        },
        {
          path: '/findDetailMore',
          name: 'findDetailMore',
          components: {
            default: resolve => require(['../pages/find/findDetailMore.vue'], resolve),
            myLoading: pageLoading
          }
        },
        {
          path: '/search',
          name: 'search',
          components: {
            default: resolve => require(['src/componentes/global/search_bar.vue'], resolve)
          }
        },
        {
          path: '/newSearch',
          name: 'newSearch',
          components: {
            default: resolve => require(['../pages/home/newSearch_bar.vue'], resolve)
          }
        },
        {
          path: '/couponQuery',
          name: 'couponQuery',
          components: {
            default: resolve => require(['../pages/coupon/index.vue'], resolve),
          }
        },
        {
          path: '/couponSearch',
          name: 'couponSearch',
          components: {
            default: resolve => require(['../pages/search/index.vue'], resolve)
          }
        },
        {
          path: '/couDetail',
          name: 'couDetail',
          components: {
            default: resolve => require(['../pages/coupon/detail.vue'], resolve)
          }
        },
        {
          path: '/cashCouDetail',
          name: 'cashCouDetail',
          components: {
            default: resolve => require(['../pages/coupon/cashDetail.vue'], resolve)
          }
        },
        {
          path: '/doComment',
          name: 'doComment',
          components: {
            default: resolve => require(['../pages/coupon/comment.vue'], resolve),
          }
        },
        {
          path: '/exchange',
          name: 'exchange',
          components: {
            default: resolve => require(['../pages/coupon/exchange.vue'], resolve)
          }
        },
        //对商户所有的评论
        {
          path: '/commentAll/:mchtId/:couponId/:replyStyle',
          name: 'commentAll',
          components: {
            default: resolve => require(['../pages/coupon/commentAll.vue'], resolve)
          }
        },
        //自己对商户的评论
        {
          path: '/commentMyself/:mchtId/:couponId/:replyStyle',
          name: 'commentMyself',
          components: {
            default: resolve => require(['../pages/coupon/commentMyself.vue'], resolve)
          }
        },
        {
          path: '/commentDetail',
          name: 'commentDetail',
          components: {
            default: resolve => require(['../pages/coupon/commentDetail.vue'], resolve),
          }
        },
        {
          path: '/exchangeSuccess',
          name: 'exchangeSuccess',
          components: {
            default: resolve => require(['../pages/coupon/exchangeSuccess.vue'], resolve)
          }
        },
        {
          /*主分类商户搜索页面*/
          path: '/classifySearchMcht',
          name: 'classifySearchMcht',
          components: {
            default: resolve => require(['../pages/home/classifySearchMcht.vue'], resolve)
          }
        },
        // {
        //   path: '/payBill',
        //   name: 'payBill',
        //   components: {
        //     default: resolve => require(['../pages/business/payBill.vue'], resolve)
        //   }
        // },
        // {
        //   path: '/consumptionNo',
        //   name: 'consumptionNo',
        //   components: {
        //     default: resolve => require(['../pages/business/consumptionNo.vue'], resolve)
        //   }
        // },
        {
          path: '/merchDetail',
          name: 'merchDetail',
          components: {
            default: resolve => require(['../pages/merchant/detail.vue'], resolve)
          }
        },
        {
           path: '/serviceInfo',
           name: 'serviceInfo',
           components: {
             default: resolve => require(['../pages/merchant/serviceInfo.vue'], resolve)
           }
        },
        {
          path: '/center',
          name: 'center',
          components: {
            default: resolve => require(['../pages/center/index.vue'], resolve),
          }
        },
        {
          path: '/userInfo',
          name: 'userInfo',
          components: {
            default: resolve => require(['../pages/center/userInfo.vue'], resolve)
          }
        },
        {
          path: '/growth-value/:max',
          name: 'growth-value',
          components: {
            default: resolve => require(['../pages/center/growth-value/index.vue'], resolve)
          }
        },
        {
          path: '/changeUserInfo/:infoType',
          name: 'changeUserInfo',
          components: {
            default: resolve => require(['../pages/center/changeUserInfo.vue'], resolve)
          }
        },
        {
          path: '/cardList',
          name: 'cardList',
          components: {
            default: resolve => require(['../pages/center/cardList.vue'], resolve)
          }
        },
        {
          path: '/bindAccount',
          name: 'bindAccount',
          components: {
            default: resolve => require(['../pages/center/bindAccount.vue'], resolve)
          }
        },
        {
          path: '/payment',
          name: 'payment',
          components: {
            default: resolve => require(['../pages/center/payment.vue'], resolve)
          }
        },
        {
          path: '/helpFeedback',
          name: 'helpFeedback',
          components: {
            default: resolve => require(['../pages/center/helpFeedback.vue'], resolve)
          }
        },
        {
          path: '/aboutUs',
          name: 'aboutUs',
          components: {
            default: resolve => require(['../pages/center/aboutUs.vue'], resolve)
          }
        },
        {
          path: '/activityList',
          name: 'activityList',
          components: {
            default: resolve => require(['../pages/merchant/activityList.vue'], resolve)
          }
        },
        {
          path: '/myGift',
          name: 'myGift',
          components: {
            default: resolve => require(['../pages/activities/newUsrBag/myGift.vue'], resolve)
          }
        },
        {
          path: '/comments',
          name: 'comments',
          components: {
            default: resolve => require(['../pages/center/comments.vue'], resolve)
          }
        },
        {
          path: '/wallet',
          name: 'wallet',
          components: {
            default: resolve => require(['../pages/center/wallet.vue'], resolve)
          }
        },
        {
          path: '/walletDetail',
          name: 'walletDetail',
          components: {
            default: resolve => require(['../pages/center/walletDetail.vue'], resolve)
          }
        },
        {
          path: '/orderDetail',
          name: 'orderDetail',
          components: {
            default: resolve => require(['../pages/center/orderDetail.vue'], resolve)
          }
        },
        {
          path: '/dealDetail/:seqNo',
          name: 'dealDetail',
          components: {
            default: resolve => require(['../pages/center/dealDetail.vue'], resolve)
          }
        },
        {
          path: '/couponDeal',
          name: 'couponDeal',
          components: {
            default: resolve => require(['../pages/center/couponDeal.vue'], resolve)
          }
        },
        {
          path: '/block',
          name: 'block',
          components: {
            default: resolve => require(['../pages/center/block.vue'], resolve)
          }
        },
        {
          path: '/myCollection',
          name: 'myCollection',
          components: {
            default: resolve => require(['../pages/center/myCollection.vue'], resolve)
          }
        },
        {
          path: '/myOrder',
          name: 'myOrder',
          components: {
            default: resolve => require(['../pages/center/myOrder.vue'], resolve)
          }
        },
        {
          path: '/orderStatus',
          name: 'orderStatus',
          components: {
            default: resolve => require(['../pages/checkOrder/index.vue'], resolve)
          }
        },
        {
          path: '/refresh',
          name: 'refresh',
          components: {
            default: resolve => require(['../pages/checkOrder/refresh.vue'], resolve)
          }
        },
        {
          path: '/firmOrder',
          name: 'firmOrder',
          components: {
            default: resolve => require(['../pages/checkOrder/firmOrder.vue'], resolve)
          }
        },
        {
          path: '/adress',
          name: 'adress',
          components: {
            default: resolve => require(['../pages/checkOrder/adress.vue'], resolve)
          }
        },

        {
          path: '/infoList',
          name: 'infoList',
          components: {
            default: resolve => require(['../pages/info/infoList.vue'], resolve)
          }
        },
        {
          path: '/systemDetail',
          name: 'systemDetail',
          components: {
            default: resolve => require(['../pages/info/systemDetail.vue'], resolve)
          }
        },
        {
          path: '/otherInfo/:type',
          name: 'otherInfo',
          components: {
            default: resolve => require(['../pages/info/otherInfo.vue'], resolve)
          }
        },
        {
          path: '/infoDetail/:type',
          name: 'infoDetail',
          components: {
            default: resolve => require(['../pages/info/infoDetail.vue'], resolve)
          }
        },
        {
          path: '/newFriend',
          name: 'newFriend',
          components: {
            default: resolve => require(['../pages/info/newFriend.vue'], resolve)
          }
        },
        {
          path: '/pendingComt',
          name: 'pendingComt',
          components: {
            default: resolve => require(['../pages/info/pendingComt.vue'], resolve)
          }
        },
        {
          path: '/expiredReminder',
          name: 'expiredReminder',
          components: {
            default: resolve => require(['../pages/info/expiredReminder.vue'], resolve)
          }
        },
        {
          path: '/walletInfo',
          name: 'walletInfo',
          components: {
            default: resolve => require(['../pages/info/walletInfo.vue'], resolve)
          }
        },
        {
          path: '/expiredDetail/:mchtId/:couponId/:couponNum',
          name: 'expiredDetail',
          components: {
            default: resolve => require(['../pages/info/expiredDetail.vue'], resolve)
          }
        },
        {
          path: '/getFriendCoupon',
          name: 'getFriendCoupon',
          components: {
            default: resolve => require(['../pages/getFriendCoupon/index.vue'], resolve),
            myLoading: pageLoading
          }
        },
        {
          path: '/friends',
          name: 'friends',
          components: {
            default: resolve => require(['../pages/friend/friends.vue'], resolve)
          }
        },
        {
          path: '/searchFriend',
          name: 'searchFriend',
          components: {
            default: resolve => require(['../pages/friend/searchFriend.vue'], resolve)
          }
        },
        {
          path: '/addFriend',
          name: 'addFriend',
          components: {
            default: resolve => require(['../pages/friend/addFriend.vue'], resolve)
          }
        },
        {
          path: '/friendDetail',
          //path: '/friendDetail/:usrId',
          name: 'friendDetail',
          components: {
            default: resolve => require(['../pages/friend/friendDetail.vue'], resolve)
          }
        },
        {
          path: '/friendShare/:type',
          name: 'friendShare',
          components: {
            default: resolve => require(['../pages/friend/friendShare.vue'], resolve)
          }
        },
        {
          path: '/shareList',
          name: 'shareList',
          components: {
            default: resolve => require(['../pages/coupon/shareList/index.vue'], resolve)
          }
        },
        { // 备注名页面
          path: '/friendRemarks',
          name: 'friendRemarks',
          components: {
            default: resolve => require(['../pages/friend/friendRemarks.vue'], resolve)
          }
        },
        {
          path: '/payIndex',
          name: 'payIndex',
          components: {
            default: resolve => require(['../pages/pay/index.vue'], resolve)
          }
        },
        {
          path: '/positiveScan',
          name: 'positiveScan',
          components: {
            default: resolve => require(['../pages/pay/positiveScan.vue'], resolve)
          }
        },
        {
          path: '/paySuccess',
          name: 'paySuccess',
          components: {
            default: resolve => require(['../pages/pay/paySuccess.vue'], resolve),
          }
        },
        {
          path: '/rewardIndex',
          name: 'rewardIndex',
          components: {
            default: resolve => require(['../pages/reward/rewardIndex.vue'], resolve),
          }
        },
        {
          path: '/rewardSuccess',
          name: 'rewardSuccess',
          components: {
            default: resolve => require(['../pages/reward/rewardSuccess.vue'], resolve),
          }
        },
        {
          path: '/businessCoupon/:mchtId',
          name: 'businessCoupon',
          components: {
            default: resolve => require(['../pages/business/businessCoupon.vue'], resolve),
          }
        },
        {
          path: '/businessOther/:mchtId/:upperMchtId',
          name: 'businessOther',
          components: {
            default: resolve => require(['../pages/business/businessOther.vue'], resolve)
          }
        },
        {
          path: '/sellingCoupon/:mchtId/:couponId',
          name: 'sellingCoupon',
          components: {
            default: resolve => require(['../pages/business/sellingCoupon.vue'], resolve)
          }
        },

        {
          path: '/qidai',
          name: 'qidai',
          components: {
            default: resolve => require(['../pages/other/index.vue'], resolve)
          }
        },
        {
          path: '/game/:id',
          name: 'game',
          components: {
            default: resolve => require(['../pages/activities/games/game/index.vue'], resolve),

          },
        },
        {
          path: '/shopIndex',
          name: 'shopIndex',
          components: {
            default: resolve => require(['../pages/activities/games/shop/index.vue'], resolve)
          }
        },
        //礼品券票务使用
        {
          path: '/useYunConpons',
          name: 'useYunConpons',
          components: {
            default: resolve => require(['../pages/center/useYunConpons.vue'], resolve)
          }
        },
        {
          path: '/RedeemCode',
          name: 'RedeemCode',
          components: {
            default: resolve => require(['../pages/center/RedeemCode.vue'], resolve)
          }
        },
         {
          path: '/usedRedeemCode',
          name: 'usedRedeemCode',
          components: {
            default: resolve => require(['../pages/center/usedRedeemCode.vue'], resolve)
          }
        },
        {
          path: '/usedRedeemCode',
          name: 'usedRedeemCode',
          components: {
            default: resolve => require(['../pages/center/usedRedeemCode.vue'], resolve)
          }
        },
        {
          path: '/myProp',
          name: 'myProp',
          components: {
            default: resolve => require(['../pages/activities/games/shop/myProp.vue'], resolve)
          }
        },
        {
          path: '/wxShare',
          name: 'wxShare',
          components: {
            default: resolve => require(['../pages/center/inviteShare.vue'], resolve)
          }
        },
        {
          path: '/ballot',
          name: 'ballot',
          components: {
            default: resolve => require(['../pages/activities/ballot/index.vue'], resolve)
          }
        },
        {
          path: '/ballot-result',
          name: 'ballot-result',
          components: {
            default: resolve => require(['../pages/activities/ballot/result.vue'], resolve)
          }
        },
        {
          path: '/ballot-result-coupon',
          name: 'ballot-result-coupon',
          components: {
            default: resolve => require(['../pages/activities/ballot/all_result.vue'], resolve)
          }
        },
        {
          path: '/addBankCard',
          name: 'addBankCard',
          meta: {keepAlive: true},
          components: {
            default: resolve => require(['../pages/center/withdrawals/addBankCard.vue'], resolve),
          }
        },
           {
          path: '/codeRotate',
          name: 'codeRotate',
          components: {
            default: resolve => require(['../pages/center/codeRotate.vue'], resolve),
          }
        },
        {
          path: '/presentResults',
          name: 'presentResults',
          components: {
            default: resolve => require(['../pages/center/withdrawals/presentResults.vue'], resolve),
          }
        },
        {
          path: '/Withdrawals',
          name: 'Withdrawals',
          components: {
            default: resolve => require(['../pages/center/withdrawals/index.vue'], resolve),
          }
        },
        {
          path: '/verification',
          name: 'verification',
          meta: {keepAlive: true},
          components: {
            default: resolve => require(['../pages/center/withdrawals/verification.vue'], resolve),
          }
        },
         {
          path: '/usrAgreement',
          name: 'usrAgreement',
          components: {
            default: resolve => require(['../pages/center/withdrawals/usrAgreement.vue'], resolve),
          }
        },
         {
          path: '/getcoupon',
          name: 'getcoupon',
          components: {
            default: resolve => require(['../pages/center/getcoupon.vue'], resolve),
          }
        },
        {
          path: '/getThirdDesc',
          name: 'getThirdDesc',
          components: {
            default: resolve => require(['../pages/center/getThirdDesc.vue'], resolve),
          }
        },
        {
          path: '*',
          name: 'not-found',
          components: {
            default: resolve => require(['../pages/home/main.vue'], resolve),
          }
        }
      ]
    }]
})
